package com.zdx.yswl.view.listview.drag;




import com.zdx.yswl.R;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.Button;
import android.widget.FrameLayout;
import android.widget.TextView;



public class BaseFootView extends FrameLayout implements DrapFootDelegate {

	public TextView textView;
	public View loadingView;
	public Button button;
	
	public static final class $_Style {
		public static int layout = R.layout.base_foot_view;
	}

	public BaseFootView(Context context) {
		super(context);
		LayoutInflater.from(context).inflate($_Style.layout, this, true);
		this.textView = (TextView) super.findViewById(R.id.textview);
		this.button = (Button) super.findViewById(R.id.button);
		this.loadingView = super.findViewById(R.id.loading_layout);
	}

	@Override
	public void setOnClickListener(OnClickListener _listener) {
		this.button.setOnClickListener(_listener);
	}

	@Override
	public View getView() {
		return this;
	}

	@Override
	public void setNormalState() {
		this.button.setVisibility(View.VISIBLE);
		this.textView.setVisibility(View.GONE);
		this.loadingView.setVisibility(View.GONE);
	}

	@Override
	public void setLoadingState() {
		this.textView.setVisibility(View.GONE);
		this.button.setVisibility(View.GONE);
		this.loadingView.setVisibility(View.VISIBLE);
	}

	public void noNextPage() {
		this.button.setVisibility(View.GONE);
		this.textView.setVisibility(View.VISIBLE);
		this.loadingView.setVisibility(View.GONE);
	}

	@Override
	public void setLoadedState() {
		this.setNormalState();
	}

}
